package com.pxr.oop.exercise;

public class Car {
    //属性
    /**
     * 车的颜色
     */
    private String color;
    /**
     * 车牌
     */
    private String licence;
    /**
     * 车速
     */
    private double speed;

    //行为
    public Car() {

    }

    public Car(String color, String licence) {
        this.color = "black";
        this.licence = "甘L8888";
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getLicence() {
        return licence;
    }

    public void setLicence(String licence) {
        this.licence = licence;
    }

    public double getSpeed() {
        return speed;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }
    //汽车启动
    public void start() {
        System.out.println("汽车启动...");
    }
    //汽车行驶
    public void run() {
        System.out.println("汽车以"+getSpeed()+"的速度进行行驶...");
    }
    //汽车停车
    public void stop() {
        System.out.println("汽车停车...");
    }
}
class Test {
    public static void main(String[] args) {
        Car car = new Car();
        car.setSpeed(60);
        car.start();
        car.run();
        car.stop();

    }
}
